<?php
session_start();
include "../../config/koneksi.php";
include "../../config/library.php";
include "../../config/fungsi_thumb.php";
include "../../config/fungsi_seo.php";

$module=$_GET[module];
$act=$_GET[act];

// Hapus berita
if ($module=='berita' AND $act=='hapus'){
  mysql_query("DELETE FROM artikel WHERE id_content='$_GET[id]'");
  header('location:../../media.php?module='.$module);
}

// Input berita
elseif ($module=='berita' AND $act=='input'){

    mysql_query("INSERT INTO artikel(judul,
                                    content,
                                    tanggal,
                                    waktu,
									username) 
                            VALUES('$_POST[judul]',
                                   '$_POST[content]',
                                   '$tgl_sekarang',
								   '$jam_sekarang',
								   '$_SESSION[namauser]')");

  header('location:../../media.php?module='.$module);
}

// Update berita
elseif ($module=='berita' AND $act=='update'){
 
    mysql_query("UPDATE artikel SET judul       = '$_POST[judul]',
									waktu  = '$jam_sekarang',
									tanggal  = '$tgl_sekarang',
                                   content  = '$_POST[content]'  
                             WHERE id_content   = '$_POST[id]'");

  header('location:../../media.php?module='.$module);
}
?>
